cmake_minimum_required(VERSION 3.10)
project(servo_ctrl LANGUAGES CXX)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 包含头文件路径
include_directories(
    ${PROJECT_SOURCE_DIR}/include
)

# 源文件列表
set(SOURCES
    src/can.cpp
    src/canopen.cpp
    src/dispatch.cpp
    src/kinco.cpp
    src/zeroerr.cpp
    src/main.cpp
)

# 指定库文件路径（假设 libcontrolcan.so 在项目根目录）
link_directories(${PROJECT_SOURCE_DIR})

# 生成可执行文件
add_executable(${PROJECT_NAME} ${SOURCES})

# 链接 libcontrolcan.so
target_link_libraries(${PROJECT_NAME} controlcan)
